/*
 * Copyright 2010 - 2011, The PLDesktop Development Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */
#ifndef PLIENUMERATOR_H
#define PLIENUMERATOR_H

#include <kernel/PLTypes.h>

namespace PLSDK {

    /**
     * Enumerator for hash objects.
     */
    template < typename hashkey, typename hashvalue >
    class PLIEnumerator {
    public:
        /**
         * Is there a next object.
         *
         * @param pos The current position.
         * @return True if there exists a next object.
         */
        virtual plbool hasNext(pluint pos) = 0;
        /**
         * Is there a previous object.
         *
         * @param pos The current position.
         * @return True if there exists a previous object.
         */
        virtual plbool hasPrevious(pluint pos) = 0;
        /**
         * Get the next object.
         *
         * @param pos The current position.
         * @return The next object.
         */
        virtual hashvalue next(pluint &pos) = 0;
        /**
         * Get the previous object.
         *
         * @param pos The current position.
         * @return The previous object.
         */
        virtual hashvalue previous(pluint &pos) = 0;
        /**
         * Get the next key object.
         *
         * @param pos The current position.
         * @return The next key object.
         */
        virtual hashkey nextKey(pluint &pos) = 0;
        /**
         * Get the previous key object.
         *
         * @param pos The current position.
         * @return The previous key object.
         */
        virtual hashkey previousKey(pluint &pos) = 0;
    };

}

#endif
